using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace CR.Domain.Entities
{
    /// <summary>
    /// 溯源管理表
    /// </summary>
    [Table("TraceabilityManagement")]
    public class TraceabilityManagement
    {
        /// <summary>
        /// 主键
        /// </summary>
        [Key]
        public int Id { get; set; }

        /// <summary>
        /// 溯源管理编号
        /// </summary>
        [Required]
        [StringLength(50)]
        public string TraceabilityCode { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        [Required]
        [StringLength(100)]
        public string ProductName { get; set; }

        /// <summary>
        /// 生产批次
        /// </summary>
        [Required]
        public DateTime ProductionBatch { get; set; }

        /// <summary>
        /// 保质期(天)
        /// </summary>
        [Required]
        public int ShelfLife { get; set; }

        /// <summary>
        /// 生产许可证号
        /// </summary>
        [Required]
        [StringLength(50)]
        public string ProductionLicenseNumber { get; set; }

        /// <summary>
        /// 生产企业
        /// </summary>
        [Required]
        [StringLength(100)]
        public string ProductionCompany { get; set; }

        /// <summary>
        /// 封面图
        /// </summary>
        [StringLength(255)]
        public string CoverImage { get; set; }

        /// <summary>
        /// 生产日期
        /// </summary>
        public DateTime? ProductionDate { get; set; }
        /// <summary>
        /// 信息完善度
        /// </summary>
        public int CompletenessScore { get; set; }

        /// <summary>
        /// 逻辑删除(0-未删除，1-已删除)
        /// </summary>
        public int IsDeleted { get; set; } = 0;

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }
    }
} 